The present invention relates to a semiconductor integrated circuit and an emulation method for checking out whether a program used by the integrated circuit runs normally. More particularly, the present invention relates to a scheme for enabling processing checkout of a program stored in an electrically programmable nonvolatile memory.
Generally speaking, in a conventional microcomputer with a built-in electrically erasable programmable ROM (E.sup.2 PROM) such as a flash memory, a writer is connected to an external pin of a chip in which the microcomputer is incorporated, and the contents stored in the E.sup.2 PROM is reprogrammed by using this writer.
However, if such a chip incorporating a microcomputer with a built-in E.sup.2 PROM is integrated with a circuit board, then all the external pins of the chip are occupied and the writer can't afford to be connected thereto in many cases. Accordingly, after the chip has been integrated with the circuit board, it is difficult for the writer to reprogram the E.sup.2 PROM.
Thus, in order to reprogram the contents of the E.sup.2 PROM after the integration, a reprogramming program may be stored beforehand in the E.sup.2 PROM and executed by a CPU provided for the microcomputer. When such a reprogramming method is employed, it is desirable to perform emulation for seeing if the reprogramming operation is normally performed based on the reprogramming program and altering the reprogramming program in accordance with the results of the checkout.
FIG. 3 shows the configuration of a conventional system including a semiconductor integrated circuit (emulation chip) and an in-circuit emulator. As shown in FIG. 3, this system includes: an in-circuit emulator 10 implemented as a personal computer, for example; an emulation chip 11 to be checked out by emulation; and an emulator interconnect bus 12 for connecting the in-circuit emulator 10 to the emulation chip 11. The in-circuit emulator 10 includes: an emulation circuit 18; and an emulation memory 17 such as a RAM in which a user program is stored. The emulation chip 11 includes: a CPU 13; an E.sup.2 PROM 14; and peripheral circuits 15 including communications circuits, A/D converters and/or time counters. The CPU 13 and the E.sup.2 PROM 14 are connected to each other by a memory interconnect bus 19, while the CPU 13 and the peripheral circuits 15 are connected to each other by a peripheral circuit interconnect bus 16. Suppose no program has been stored in the E.sup.2 PROM 14 yet.
Hereinafter, the emulation operation performed by the system shown in FIG. 3 will be described. First, the emulation chip 11 is set at emulation mode, thereby allowing electrical communication through the emulator interconnect bus 12 and prohibiting communication through the memory interconnect bus 19. In such a state, the user program stored in the emulation memory 17 is provided to the CPU 13 of the emulation chip 11 to make the CPU 13 perform a simulated operation. On the other hand, while the emulation chip 11 performs a normal operation (i.e., an operation carried out based on a user program stored in the built-in E.sup.2 PROM 14), the emulator interconnect bus 12 is disconnected and electrical communication through the memory interconnect bus 19 is allowed.
However, in such a conventional system, if a reprogramming program is stored in the E.sup.2 PROM built in a microcomputer, it is impossible to check out whether or not the reprogramming operation is performed normally based on the reprogramming program.
More specifically, during the emulation, electrical communication is allowed through the emulator interconnect bus 12, but not through the memory interconnect bus 19 used for the normal operation. Thus, the emulation can be performed on nothing but the emulation memory 17 connected to the emulator interconnect bus 12. In addition, it is harder to reprogram the contents of an E.sup.2 PROM than reprogramming the contents of a RAM or the like. And a write level should be checked to see if the reprogramming processing has been performed normally in the E.sup.2 PROM. By comparison, the emulation memory 17 is reprogrammable more easily than the E.sup.2 PROM 14. Thus, even if it has been confirmed that reprogramming processing has been performed normally in the emulation memory 17, it is sometimes impossible to check out whether or not reprogramming processing has been performed normally in the E.sup.2 PROM based on the reprogramming program.